﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="create_Folder.aspx.cs" Inherits="SQT.tracnghiem.Ajax.ASP.Gallery.create_Folder" %>

<%@ Import Namespace="DataAccess" %>
<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<body>
    <%
        int parent = int.Parse(Request.QueryString["parent"]);
        string name = Request.QueryString["name"];
        new TblLibraryController().Insert(name, "", int.Parse(Session["admin_id"].ToString()), DateTime.Now, 0, parent, DateTime.Now, int.Parse(Session["admin_id"].ToString()), false, false);
        var get_last = new TblLibraryController().FetchAll().Last();
        var get_uploader = new TblManagerController().FetchAll().Where(x => x.ManagerId == get_last.LibraryUploader).Single();
        var get_editor = new TblManagerController().FetchAll().Where(x => x.ManagerId == get_last.LibraryEditor).Single();
        string upload_date = "", edit_date = "";
        DateTime date = DateTime.Parse(get_last.LibraryUploadDate.ToString());
        upload_date = date.Day + "/" + date.Month + "/" + date.Year + " " + date.Hour + ":" + date.Minute;
        date = DateTime.Parse(get_last.LibraryEditDate.ToString());
        edit_date = date.Day + "/" + date.Month + "/" + date.Year + " " + date.Hour + ":" + date.Minute;
    %>
    <tr id="item<%=get_last.LibraryId %>">
        <td ondblclick="gal_open_menu_left(event, 'allfolder','<%=get_last.LibraryParent %>');open_folder('<%=get_last.LibraryId %>','<%=get_last.LibraryName %>');title_top('<%=get_last.LibraryId %>')" class="gal-table-name"><i class="fa fa-folder"></i><%=get_last.LibraryName %></td>
        <td class="gal-table-date"><span title="<%=get_uploader.FullName %>" data-toggle="tooltip" data-placement="bottom"><%=upload_date %></span></td>
        <td class="gal-table-modified"><span title="<%=get_editor.FullName %>" data-toggle="tooltip" data-placement="bottom"><%=edit_date %></span></td>
        <td class="gal-table-options">
            <i title="Mở thư mục" data-toggle="tooltip" data-placement="bottom" class="fa fa-folder-open w3-hover-text-teal"></i>
            <i onclick="gal_rename('<%=get_last.LibraryName %>')" title="Đổi tên" data-toggle="tooltip" data-placement="bottom" class="fa fa-edit w3-hover-text-teal"></i>
            <i onclick="gal_move('<%=get_last.LibraryId %>')" title="Di chuyển" data-toggle="tooltip" data-placement="bottom" class="fa fa-external-link w3-hover-text-teal"></i>
            <i onclick="gal_delete()" title="Xóa" data-toggle="tooltip" data-placement="bottom" class="fa fa-trash w3-hover-text-teal"></i>
        </td>
    </tr>
</body>
</html>
